package com.canaan.business.common.enums.invoice;

public enum MaterialPreparationStatusEnum {
    NEW(1, "新建"),
    CONFIRMED(2,"已确认"),
    IN_HAND(3, "进行中"),
    ACCOMPLISH(4, "已完成"),
    ;

    private final Integer code;
    private final String message;

    MaterialPreparationStatusEnum(Integer code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static String getMessageByCode(Integer code){
        if(code == null){
            return null;
        }
        String message = null;
        for (MaterialPreparationStatusEnum value : values()) {
            if(value.getCode().equals(code)){
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
